﻿var flag=0;
function f_s(id){
       var obj=document.getElementById(id);
       obj.style.display="block";
       obj.style.height="1px"; 
       var changeW=function(){ 	 		
              var obj_h=parseInt(obj.style.height);
              if(obj_h<=240){ 
                     obj.style.height=(obj_h+Math.ceil((240-obj_h)/10))+"px";
              }
              else{ 
              clearInterval(bw1);
              }
       }       
       bw1= setInterval(changeW,1);
	   if(flag>0){
	   	 clearInterval(bw2);
	   }
}
function closeW(id){
		flag++;
       var obj=document.getElementById(id);
       var closeDiv=function(){
clearInterval(bw1);
              var obj_h=parseInt(obj.style.height);
              if(obj_h>1){ 
                     obj.style.height=(obj_h-Math.ceil(obj_h)/10)+"px";
					
              }
              else{
              clearInterval(bw2);
              obj.style.display="none";
              }
       }         
      bw2= setInterval(closeDiv,1);
}
function showDiv(){ 
	var ele = document.getElementById("div1");
	clearInterval(bw1);
	clearInterval(bw2);
	ele.style.display = "block";
	ele.style.height = 240 + "px";	
}